#
# Latex-aware Makefile example
#
# This assumes your latex source is in paper.tex, and that your
# citations are in references.bib
#
# Jim Teresco
#
# Wed Nov 20 14:30:15 EST 2002
#
LATEXSOURCE=thesis
REFERENCES=references.bib
DVIPS=dvips -P pdf -t letter
LATEX=latex
BIBTEX=bibtex
PS2PDF=ps2pdfwr

.SUFFIXES: .tex .dvi .ps .bbl .aux .pdf

all::	psfile

pdffile::	$(LATEXSOURCE).pdf

psfile::	$(LATEXSOURCE).ps

.dvi.ps:
	$(DVIPS) $< -o

.ps.pdf:
	$(PS2PDF) $<

$(LATEXSOURCE).dvi:	$(LATEXSOURCE).tex $(LATEXSOURCE).bbl
	$(LATEX) $(LATEXSOURCE)

$(LATEXSOURCE).bbl:	$(LATEXSOURCE).aux $(REFERENCES)
	$(LATEX) $(LATEXSOURCE)
	$(LATEX) $(LATEXSOURCE)
	$(BIBTEX) $(LATEXSOURCE)
	$(LATEX) $(LATEXSOURCE)
	$(LATEX) $(LATEXSOURCE)

$(LATEXSOURCE).aux:	$(LATEXSOURCE).tex
	$(LATEX) $(LATEXSOURCE)

.tex.dvi:
	$(LATEX) $<

clean::
	/bin/rm -f $(LATEXSOURCE).ps $(LATEXSOURCE).dvi \
	$(LATEXSOURCE).aux $(LATEXSOURCE).blg $(LATEXSOURCE).log \
	$(LATEXSOURCE).bbl $(LATEXSOURCE).pdf

